<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/include.inc.jsp"%>
<html>
<head>
   <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>主页</title>
  
	
	<script src="${ctx}/js/jquery-1.7.2.js"></script>
	<script src="${ctx}/easy-ui/jquery.easyui.min.js" type="text/javascript"></script> 
	<script src="${ctx}/easy-ui/locale/easyui-lang-zh_CN.js"></script>
	<script src="${ctx}/easy-ui/easyloader.js"></script>
	<script src="${ctx}/easy-ui/plugins/jquery.panel.js"></script>
	<script src="${ctx}/easy-ui/plugins/jquery.dialog.js"></script>
    <script type="text/javascript" src="${ctx}/js/prettify.js"></script>
    <link href="${ctx}/easy-ui/themes/default/easyui.css" rel='stylesheet' type='text/css' />
    <link rel="stylesheet" href="${ctx}/css/kube.css" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="${ctx}/easy-ui/themes/icon.css">
    
    <script type="text/javascript">
    $(function () {
        $('#tt').tabs({
            onLoad: function (panel) {
                var plugin = panel.panel('options').title;
                panel.find('textarea[name="code-' + plugin + '"]').each(function () {
                    var data = $(this).val();
                    data = data.replace(/(\r\n|\r|\n)/g, '\n');
                    if (data.indexOf('\t') == 0) {
                        data = data.replace(/^\t/, '');
                        data = data.replace(/\n\t/g, '\n');
                    }
                    data = data.replace(/\t/g, '    ');
                    var pre = $('<pre name="code" class="prettyprint linenums"></pre>').insertAfter(this);
                    pre.text(data);
                    $(this).remove();
                });
                prettyPrint();
            }
        });
        var sw = $(window).width();
        if (sw < 767) {
            $('body').layout('collapse', 'west');
        }
        $('.navigation-toggle span').bind('click', function () {
            $('#head-menu').toggle();
        });
        $(".tabs-header").bind('contextmenu',function(e){
			e.preventDefault();
			$('#rcmenu').menu('show', {
				left: e.pageX,
				top: e.pageY
			});
		});
        
		//关闭当前标签页
		$("#closecur").bind("click",function(){
			var tab = $('#tt').tabs('getSelected');
			var index = $('#tt').tabs('getTabIndex',tab);
			$('#tt').tabs('close',index);
		});
		//关闭所有标签页
		$("#closeall").bind("click",function(){
			var tablist = $('#tt').tabs('tabs');
			for(var i=tablist.length-1;i>=0;i--){
				$('#tt').tabs('close',i);
			}
		});
		//关闭非当前标签页（先关闭右侧，再关闭左侧）
		$("#closeother").bind("click",function(){
			var tablist = $('#tt').tabs('tabs');
			var tab = $('#tt').tabs('getSelected');
			var index = $('#tt').tabs('getTabIndex',tab);
			for(var i=tablist.length-1;i>index;i--){
				$('#tt').tabs('close',i);
			}
			var num = index-1;
			for(var i=num;i>=0;i--){
				$('#tt').tabs('close',0);
			}
		});
		//关闭当前标签页右侧标签页
		$("#closeright").bind("click",function(){
			var tablist = $('#tt').tabs('tabs');
			var tab = $('#tt').tabs('getSelected');
			var index = $('#tt').tabs('getTabIndex',tab);
			for(var i=tablist.length-1;i>index;i--){
				$('#tt').tabs('close',i);
			}
		});
		//关闭当前标签页左侧标签页
		$("#closeleft").bind("click",function(){
			var tab = $('#tt').tabs('getSelected');
			var index = $('#tt').tabs('getTabIndex',tab);
			var num = index-1;
			for(var i=0;i<=num;i++){
				$('#tt').tabs('close',0);
			}
		});
    });
    //增加不重复的tab
    function addTab(title, url){
		if ($('#tt').tabs('exists', title)){
			$('#tt').tabs('select', title);
		} else {
			var content=url;
			$('#tt').tabs('add',{
				title:title,
				href:content,
				closable:true
			});
		}
	}
    </script>
   
</head>
<body class="easyui-layout">

<div region="north" border="false" class="group wrap header" style="height:55px;font-size:100%">
<div class="admin_top">
		<div class="admin_topdiv">
	        <span>
	                <a href="javascript:;">${username}</a> 
	                <a href="javascript:main();">首页</a>
			        <a href="javascript:;" style="margin-left:-20px">修改密码</a>
			        <a href="${ctx}/common/login/logout">退出</a> 
	        </span>
 </div>
</div>
</div>
<div region="west" split="true" title="后台管理系统" style="width:10%;min-width:100px;padding:5px;">
    <ul class="easyui-tree">
    	<c:if test="${sessionScope.usertype==1}">
	        <li iconCls="icon-base"><span>综合统计</span>
	            <ul>
	                <li iconCls="icon-gears"><a href="#" onclick="addTab('综合统计','/adminMange/common')">综合统计</a></li>
	            </ul>
	        </li>
	        <li iconCls="icon-layout"><span>用户管理</span>
	            <ul>
	                <li iconCls="icon-gears"><a href="#"  onclick="addTab('用户管理','${ctx}/user/page?jspname=user/userlist')">用户管理</a></li>
	                <li iconCls="icon-gears"><a href="#"  onclick="addTab('房主列表','/user/page?jspname=user/hourselist')">房主列表</a></li>
	                <li iconCls="icon-gears"><a href="#"  onclick="addTab('房主待审核','/user/page?jspname=user/hoursechecklist')">房主待审核</a></li>
	                <li iconCls="icon-gears"><a href="#"  onclick="addTab('用户收支明细','/user/page?jspname=user/winpayflowlist')">用户收支明细</a></li>
	            </ul>
	        </li>
	        <li iconCls="icon-layout"><span>财务管理</span>
	            <ul>
	                <li iconCls="icon-gears"><a href="#" onclick="addTab('财务统计','/fiance/page')">财务统计</a></li>
	                <li iconCls="icon-gears"><a href="#" onclick="addTab('提现管理','/fiance/present')">提现管理</a></li>
	            </ul>
	        </li>
	        <li iconCls="icon-layout"><span>彩票管理</span>
	            <ul>
	                <li iconCls="icon-gears"><a href="#" onclick="addTab('彩票订单','/lotterorder/page')">彩票订单</a></li>
	            </ul>
	        </li>
      </c:if>
      <c:if test="${sessionScope.usertype==2}">
		      <li iconCls="icon-layout"><span>彩票管理</span>
			            <ul>
			                <li iconCls="icon-gears"><a href="#" onclick="addTab('彩票订单','/lotterorder/page')">彩票订单</a></li>
			            </ul>
	        </li>
      </c:if>
    </ul>
</div>
<div region="center">
    <div id="tt" class="easyui-tabs" fit="true" border="false" plain="true">
       <div title="welcome" class="/adminMange/common"></div>
    </div>
    <div id="rcmenu" class="easyui-menu" style="">
			<div data-options="iconCls:'icon-cancel'" id="closecur">
				关闭当前页
			</div>
			<div id="closeall">
				关闭全部
			</div>
			<div id="closeother">
				关闭其他
			</div>
			<div class="menu-sep"></div>
			<div id="closeright">
				关闭右侧标签页
			</div>
			<div id="closeleft">
				关闭左侧标签页
			</div>
	</div>
	
</div>
<div data-options="region:'south',split:true" style="height:50px;">
   <div class="section">
            版权所有 2003-2005 中国证券业协会 京ICP备05036061号 京公网安备110102001337 版本号：V20141128
   </div>
</div>
</body>
</html>